import React from 'react';
import { Col, Row, Popover, Button } from 'antd';
import './index.less'
import Util from '../../utils/utils';
import { NavLink } from 'react-router-dom';
import api from '../../axios'

class index extends React.Component {
    constructor(props) {
        super(props);
        this.state = { 
            userName: Util.getStorage("userInfo").username || '',
            qrcode: 'http://petroleum.wxxcsls.cn/home.jpg'
         };
    }

    

    // 获取时间
    async componentDidMount(){
        setInterval(()=>{
            let sysTime = Util.formateDate(new Date().getTime());
            this.setState({
                sysTime
            })
        },1000);
    }
    


    render() {
        return (
            <div className="header">
                <Row className="header-top">
                    <Col span="24">
                        <span className='welcome'>欢迎，{this.state.userName}</span> &nbsp; <NavLink to={'/login'}><strong>退出</strong></NavLink>
                    </Col>
                </Row>
                
                <Row className="breadcrumb">
                  
                    <div>
                        <span className="date">{this.state.sysTime}</span>
                        <span className="weather-img">
                            <img src={this.state.dayPictureUrl} alt=""/>
                        </span>
                        <span className="weather-detail">{this.state.weather}</span>
                    </div>
                </Row>
            </div>
        );
    }
}

export default index;